/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package classesEntidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author ra106797
 */
@Entity
@Table(name = "CURSOCURRICULO")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Cursocurriculo.findAll", query = "SELECT c FROM Cursocurriculo c"),
    @NamedQuery(name = "Cursocurriculo.findById", query = "SELECT c FROM Cursocurriculo c WHERE c.id = :id"),
    @NamedQuery(name = "Cursocurriculo.findByNome", query = "SELECT c FROM Cursocurriculo c WHERE c.cursocurriculoPK.nome = :nome"),
    @NamedQuery(name = "Cursocurriculo.findByCodigo", query = "SELECT c FROM Cursocurriculo c WHERE c.cursocurriculoPK.codigo = :codigo"),
    @NamedQuery(name = "Cursocurriculo.findByNomemodalidade", query = "SELECT c FROM Cursocurriculo c WHERE c.cursocurriculoPK.nomemodalidade = :nomemodalidade"),
    @NamedQuery(name = "Cursocurriculo.findByCodmodalidade", query = "SELECT c FROM Cursocurriculo c WHERE c.cursocurriculoPK.codmodalidade = :codmodalidade"),
    @NamedQuery(name = "Cursocurriculo.findByAnocatalogo", query = "SELECT c FROM Cursocurriculo c WHERE c.cursocurriculoPK.anocatalogo = :anocatalogo")})
public class Cursocurriculo implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected CursocurriculoPK cursocurriculoPK;
    @Basic(optional = false)
    @Column(name = "ID")
    private int id;

    public Cursocurriculo() {
    }

    public Cursocurriculo(CursocurriculoPK cursocurriculoPK) {
        this.cursocurriculoPK = cursocurriculoPK;
    }

    public Cursocurriculo(CursocurriculoPK cursocurriculoPK, int id) {
        this.cursocurriculoPK = cursocurriculoPK;
        this.id = id;
    }

    public Cursocurriculo(String nome, String codigo, String nomemodalidade, String codmodalidade, String anocatalogo) {
        this.cursocurriculoPK = new CursocurriculoPK(nome, codigo, nomemodalidade, codmodalidade, anocatalogo);
    }

    public CursocurriculoPK getCursocurriculoPK() {
        return cursocurriculoPK;
    }

    public void setCursocurriculoPK(CursocurriculoPK cursocurriculoPK) {
        this.cursocurriculoPK = cursocurriculoPK;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cursocurriculoPK != null ? cursocurriculoPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Cursocurriculo)) {
            return false;
        }
        Cursocurriculo other = (Cursocurriculo) object;
        if ((this.cursocurriculoPK == null && other.cursocurriculoPK != null) || (this.cursocurriculoPK != null && !this.cursocurriculoPK.equals(other.cursocurriculoPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "classesEntidades.Cursocurriculo[ cursocurriculoPK=" + cursocurriculoPK + " ]";
    }
    
}
